import wmi

# 获取wmi对象
c = wmi.WMI()
# 读取主板信息
board_info = c.Win32_BaseBoard()
# 获取具体的主板id
board_id = board_info[0].SerialNumber.strip()
print(board_id)
# 获取电脑名字
wmi_win32_operating_system = c.Win32_OperatingSystem()[0]
computer_name = wmi_win32_operating_system.CSName
print(computer_name)
